package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.constant.MessageConstant;
import com.itheima.entity.PageResult;
import com.itheima.entity.Result;
import com.itheima.pojo.Address;
import com.itheima.pojo.Setmeal;
import com.itheima.service.AdressService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/address")
public class AddressController{

    @Reference
    private AdressService adressService;

    @RequestMapping("/findAddressName")
    public Result findAll(){
        try {
            List<String> addressName = adressService.findAddressName();
            System.out.println(addressName);
            return new Result(true, MessageConstant.QUERY_ADRESS_SUCCESS,addressName);
        } catch (Exception e) {
            e.printStackTrace();
            return new Result(false,MessageConstant.QUERY_ADRESS_FAIL);

        }
    }

}
